<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>药品入库</title>
<link href="${ctx}/js/validate/jquery.validate.css" type="text/css" rel="stylesheet"/>
<script src="${ctx}/js/validate/jquery.validate.js" type="text/javascript"></script>
<script src="${ctx}/js/validate/messages_cn.js" type="text/javascript"></script>
<script src="${ctx}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<script>
		$(document).ready(function() {
			//聚焦第一个输入框
			$("#purchaseBatch").focus();
			//为inputForm注册validate函数
			$("#mainForm").validate({
				rules: {
					purchaseBatch: "required",
					supplier: "required",
					accepterID: "required",
					purchasePrice: {number:true},
					drugName: "required",
					productBatch: "required",
					unit: "required",
					amount: {required:true, digits:true,min:1},
					usefulLife: "required",
					production: "required"
				}
			});
		});
	</script>
</head>
<body>
<div style="font-family:Arial;font-size:15px;font-weight:bold;font-style:normal;align:left">当前位置：校园诊所--药品管理--药品入库 </div>
<s:form id="mainForm" action="medicine!save.action" method="post">
<input type="hidden" name="id" value="${id}"/>
	<table>
		<tr>
			<td>*&nbsp;入库单号：</td>
			<td><input type="text" name="purchaseBatch" size="20" id="purchaseBatch" value="${purchaseBatch}"/></td>
			<td>*&nbsp;入库方式：</td>
			<td><s:select name="whsTypeId" id="whsTypeId" style="width:150px" theme="simple"
				list="whsTypeList" listKey="id" listValue="term" value="%{whsType.id}"></s:select>
			</td> 
		</tr>
		<tr>
			<td>*&nbsp;供应商：</td>
			<td><input type="text" name="supplier" size="20" id="supplier" value="${supplier}" /></td>
			<td>*&nbsp;验收人：</td>
			<td><input type="text" name="accepterID" size="20" id="accepterID" value="${accepter.idNumber}" /></td>
		</tr>
		<tr>
			<td>*&nbsp;入库药房：</td>
			<td><s:select name="whsPharmacyId" id="whsPharmacyId" theme="simple" value="%{whsPharmacy.id}"
				list="pharmacyList" style="width:150px" listKey="id" listValue="term" /></td>
			<td>*&nbsp;入库价：</td>
			<td><input type="text" name="purchasePrice" size="20" id="purchasePrice" value="${purchasePrice}" /></td>
		</tr>
		<tr>
			<td>*&nbsp;药品名称：</td>
			<td><input type="text" name="drugName" size="20" id="drugName" value="${drug.term}"/></td>
			<td>*&nbsp;批号：</td>
			<td><input type="text" name="productBatch" size="20" id="productBatch" value="${productBatch}" /></td>
		</tr>
		<tr>
			<td>*&nbsp;规格：</td>
			<td><input type="text" name="unit" size="20" id="unit" value="${unit}" /></td>
			<td>*&nbsp;数量：</td>
			<td><input type="text" name="amount" size="20" id="amount" value="${amount}"/></td> 
		</tr>
		<tr>
			<td>*&nbsp;有效期至：</td>
			<td><input type="text" name="shelfLife" size="20" id="shelfLife" readonly="readonly" 
					   value="<s:date name='shelfLife' format='yyyy-MM-dd'/>" 
					   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-%d'})"/> 
				</td>
			<td>*&nbsp;生产单位：</td>
			<td><input name="production" size="20" id="production" value="${production}"/></td>
		</tr>
		<tr align="center">
			<td colspan="2"><s:submit type="button" theme="simple" >保存</s:submit>
			<s:reset type="button" onclick="history.back()" theme="simple" value="取消" ></s:reset></td>
		</tr>
	</table>
</s:form>
</body>
</html>